package urban_seed_ph

import (
	"fmt"
	"gitee.com/theegg/go-brick/app/model/urban/urban_elements"
	"gitee.com/theegg/go-brick/app/service/app"
)

// 便民 seed
func InitPartnerConvenientElementsSeed() {

	items := make(map[int]urban_elements.UrbanElements)

	items[450001] = urban_elements.UrbanElements{
		Id:          450001,
		PartnerSign: "default",
		Lang:        "cn",
		Title:       "悠悠超市",
		TitleEn:     "YoYo Market",
		TypeId:      5,
		TypeSubId:   5001,
		Summary:     "超市提供外送服务, 有各种奶茶, 零食等",
		Content:     "",

		OpenTime:    "08:00",
		CloseTime:   "02:00",
		OpenWeekDay: "1,2,3,4,5,6,7",

		Phone: "+639151351193",

		Tags: "物品丰富,送货快,位置安全",

		ProvinceId: 1025,
		CityId:     1025017,
		Address:    "2F-6 7th Avenue, Corner 25th Street & Federation Drive, Taguig, 1630 Metro Manila, Philippines",

		CoordinateX: "14.5477561",
		CoordinateY: "121.0466684",
		PlusCode:    "G2XX+4G 塔吉格 菲律宾 Metro Manila",

		ImageCover: "",
		ImageList:  "",

		ImageCount:  0,
		ViewCount:   0,
		IsHot:       false,
		IsRecommend: false,
		Status:      1,
	}

	count := 0
	errCount := 0
	for _, item := range items {
		_, err := app.Db().Insert(item)
		if err != nil {
			fmt.Println(err.Error())
			errCount++
		} else {
			count++
		}
	}

	fmt.Printf("%5s|%25s|%10d|%8d|\n", "", "urban_elements", count, errCount)
}
